 
 <#-- 
 
 creates a sentence for create a table in sql server...
 
 
 -->
<#-- variables used internally by the generator... -->
<#assign nameFile="sql">
<#assign extensionFile="sql">
<#assign languageGenerated="sql">
<#assign description="sql">
<#assign targetDirectory="sql">
<#assign appliesToAllTables="true">
<#-- END variables used internally by the generator... -->


 


 
 
#
# Table structure for table '${table}'
#


CREATE TABLE "${table}" (
 
	<#list table.getFields() as field>
	 
		 <#-- segun el tipo de campo...   -->
		 <#switch field.getType()>
			  <#case "_int">
				 <#if (field.getisKey())>
					   [${field}] [int] IDENTITY(1,1) NOT NULL,
					<#else>
						 [${field}] [int] NULL default (0),
				</#if>
				<#break>
			  <#case "_string">
				<#if (field.getSize() == 1)>
					    [${field}] [char](1) COLLATE Modern_Spanish_CI_AS NULL default (''),
					<#else>
						 [${field}] [varchar](${field.getSize()}) COLLATE Modern_Spanish_CI_AS NULL,
				</#if>
			    
			     <#break>
			  <#case "_date">
				[${field}] [datetime] NULL,
			     <#break>
			  <<#case "_boolean">
				[${field}] [bit] NULL DEFAULT ((0)),
			     <#break>
			  <#default>
			    [${field}] [varchar](${field.getSize()}) COLLATE Modern_Spanish_CI_AS NULL,			    
		</#switch>  
	</#list>		
	PRIMARY KEY  (${table.getListOnlyKeyFields()}),
	 
);


 


